package com.ruoyi.active.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.active.mapper.LotteryPrizeMapper;
import com.ruoyi.active.domain.LotteryPrize;
import com.ruoyi.active.service.ILotteryPrizeService;

/**
 * 抽奖奖品Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-01
 */
@Service
public class LotteryPrizeServiceImpl implements ILotteryPrizeService 
{
    @Autowired
    private LotteryPrizeMapper lotteryPrizeMapper;

    /**
     * 查询抽奖奖品
     * 
     * @param prizeId 抽奖奖品主键
     * @return 抽奖奖品
     */
    @Override
    public LotteryPrize selectLotteryPrizeByPrizeId(Long prizeId)
    {
        return lotteryPrizeMapper.selectLotteryPrizeByPrizeId(prizeId);
    }

    /**
     * 查询抽奖奖品列表
     * 
     * @param lotteryPrize 抽奖奖品
     * @return 抽奖奖品
     */
    @Override
    public List<LotteryPrize> selectLotteryPrizeList(LotteryPrize lotteryPrize)
    {
        return lotteryPrizeMapper.selectLotteryPrizeList(lotteryPrize);
    }

    /**
     * 新增抽奖奖品
     * 
     * @param lotteryPrize 抽奖奖品
     * @return 结果
     */
    @Override
    public int insertLotteryPrize(LotteryPrize lotteryPrize)
    {
        lotteryPrize.setCreateTime(DateUtils.getNowDate());
        return lotteryPrizeMapper.insertLotteryPrize(lotteryPrize);
    }

    /**
     * 修改抽奖奖品
     * 
     * @param lotteryPrize 抽奖奖品
     * @return 结果
     */
    @Override
    public int updateLotteryPrize(LotteryPrize lotteryPrize)
    {
        lotteryPrize.setUpdateTime(DateUtils.getNowDate());
        return lotteryPrizeMapper.updateLotteryPrize(lotteryPrize);
    }

    /**
     * 批量删除抽奖奖品
     * 
     * @param prizeIds 需要删除的抽奖奖品主键
     * @return 结果
     */
    @Override
    public int deleteLotteryPrizeByPrizeIds(Long[] prizeIds)
    {
        return lotteryPrizeMapper.deleteLotteryPrizeByPrizeIds(prizeIds);
    }

    /**
     * 删除抽奖奖品信息
     * 
     * @param prizeId 抽奖奖品主键
     * @return 结果
     */
    @Override
    public int deleteLotteryPrizeByPrizeId(Long prizeId)
    {
        return lotteryPrizeMapper.deleteLotteryPrizeByPrizeId(prizeId);
    }
}
